package com.cys.dm.client.user;

import com.cys.dm.entity.user.DmUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "dm-user-provider")
public interface DmUserClient {
    @PostMapping(path = "/user/findByPhoneAndPassword")
    DmUser findByPhoneAndPassword(@RequestParam("phone")String phone, @RequestParam("password")String password);

    @PostMapping(path = "/user/findByVerification")
    DmUser findByVerification(@RequestParam("phone")String phone);

    @PostMapping(path = "/user/finById")
    DmUser findById(@RequestParam("userId")Long userId);

    @PostMapping(path = "/user/updataUserById")
    public Integer updateUserById(@RequestBody DmUser dmUser);

    @PostMapping(path = "/user/saveUser")
    public Integer saveUser(@RequestBody DmUser dmUser);

    @PostMapping(path = "/user/findByPhone")
    public DmUser findByPhone(@RequestParam("phone") String phone);

}
